package com.warm.pump.module.work.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.HashMap;

import com.warm.pump.module.work.dao.gen.WorVersionDao;
import com.warm.pump.module.work.bean.po.gen.WorVersion;
import com.warm.pump.module.work.service.IWorVersionService;
import com.warm.pump.frame.gen.bean.PageBean;



@Service("WorVersionService")
public class WorVersionServiceImpl implements IWorVersionService {
	@Autowired
	private WorVersionDao worVersionDao;

	@Override
	public WorVersion queryObject(Long  id){
		return worVersionDao.selectByPrimaryKey( id);
	}

	public WorVersion queryObject(Map<String, Object> map){
		return worVersionDao.selectByMap( map);
	}
	
	@Override
	public List<WorVersion> queryList(Map<String, Object> map){
		return worVersionDao.getListByMap(map);
	}

    @Override
    public PageBean getPageBeanByMap(Map map,int pageNo,int pageSize) {
		return worVersionDao.getPageBeanByMap(map, pageNo, pageSize);
    }


	@Override
	public int queryTotal(Map<String, Object> map){
		return worVersionDao.countTotalByMap(map);
	}
	
	@Override
	public void save(WorVersion worVersion){
		worVersionDao.insertSelective(worVersion);
	}
	
	@Override
	public void update(WorVersion worVersion){
		worVersionDao.updateByPrimaryKeySelective(worVersion);
	}
	
	@Override
	public void delete(Long  id){
		worVersionDao.deleteByPrimaryKey(id);
	}

	@Override
	public void delete(Map<String, Object>  map){
	worVersionDao.deleteByMap(map);
	}
	
	@Override
	public void deleteBatch(Long[]  ids){
		Map<String, Object> map = new HashMap<>();
		map.put("id_in",ids);
		worVersionDao.deleteByMap(map);
	}
	
}
